package com.jecy.spi;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * <p> </p>
 *
 * @author huijun
 * @create 2018-10-30 15:07
 **/
public class ServiceMain {
    public static void main(String[] args) {
        ServiceLoader<DubboService> serviceLoader = ServiceLoader.load(DubboService.class);
        Iterator<DubboService> iterable =  serviceLoader.iterator();
        while (iterable.hasNext()){
            DubboService dubboService = iterable.next();
            dubboService.sayHello();
        }
    }
}
